﻿using System;
using System.Collections.Generic;
using System.Text;
using EZBarTender.DataAccess.DAO.EZBTTableAdapters;
using EZBarTender.DataAccess.DAO;

namespace EZBarTender.DataAccess.Service
{
    public class FutureProductBatchService
    {
        private DSDFutureBatchTableAdapter tableAdapter;

        public FutureProductBatchService(string connectionString)
        {
            tableAdapter = new DSDFutureBatchTableAdapter();
            tableAdapter.Connection.ConnectionString = connectionString;
        }

        public EZBT.DSDFutureBatchDataTable getByBatchNoAndModified(String batchNo, String printTagFlag, DateTime startDate, DateTime endDate, bool includeRehangs)
        {
            if (includeRehangs)
                return tableAdapter.GetDataByBatchNoModifiedWithRehangs(batchNo, printTagFlag, startDate, endDate);
            else
                return tableAdapter.GetDataByBatchNoModifiedNoRehangs(batchNo, printTagFlag, startDate, endDate);
        }

        public EZBT.DSDFutureBatchDataTable getByBatchNo(string batchNo, char printTagFlag, bool includeRehangs)
        {
            if (includeRehangs)
                return tableAdapter.GetDataByBatchNoWithRehangs(batchNo, printTagFlag.ToString());
            else
                return tableAdapter.GetDataByBatchNoNoRehangs(batchNo, printTagFlag.ToString());
        }
    }
}
